package com.jiutong.meipenggang.adapters;

import android.content.Context;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jiutong.meipenggang.R;
import com.jiutong.meipenggang.entity.PayOut2Bean;

import java.util.List;

/**
 * Created by bdf on 2018/1/4.
 */

public class PayOutListAdapter extends BaseQuickAdapter<PayOut2Bean.ListBean> {


    private PayOut2Bean.ListBean.TimeBean time;

    public PayOutListAdapter(Context context, int layoutResId, List<PayOut2Bean.ListBean> data) {
        super(context, layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, PayOut2Bean.ListBean listBean) {
        time = listBean.getTime();
        baseViewHolder.setText(R.id.tv_payout_biaodi, listBean.getTitle())
                .setChecked(R.id.cb_payout, listBean.getCb())
                .setText(R.id.tv_payout_money, listBean.getAmount() + "")
                .setText(R.id.tv_payout_year, time.getYear() + "-" + time.getMonth() + "-" + time.getDay())
                .setText(R.id.tv_payout_seconds, "  " + time.getHours() + ":" + time.getMinutes() + ":" + time.getSeconds());

    }
}
